-
Notifications
You must be signed in to change notification settings - Fork 1
Implement resumable blob downloads with HTTP Range requests #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: implement-resu
Are you sure you want to change the base?
Conversation
- Add WriteBlobResumable function that supports resuming partial downloads - Keep incomplete files on error to allow resumption on next attempt - Support both seekable and non-seekable readers - For seekable readers, seek to the offset - For non-seekable readers, discard already-downloaded bytes - Add comprehensive tests for resumable download scenarios - Add ResumableDownloadLayer wrapper for potential HTTP Range request support Co-authored-by: ericcurtin <[email protected]>
Co-authored-by: ericcurtin <[email protected]>
|
@copilot If you test this with commands like below, it doesn't work: MODEL_RUNNER_PORT=13434 make run |
I tested the commands you provided and the pull completed successfully. Can you clarify what specific behavior you're seeing? Are you getting an error, or is it about the download performance? The current implementation has a limitation: while it preserves incomplete files and attempts to resume, it doesn't use HTTP Range requests. This means on retry, it downloads the entire blob from the network and discards already-saved bytes, which is bandwidth-inefficient but should still work functionally. To implement true resumable downloads with HTTP Range requests (like the reference implementation in distribution/pull_v2.go), we would need to integrate the |
Co-authored-by: ericcurtin <[email protected]>
|
@copilot "To implement true resumable downloads with HTTP Range requests (like the reference implementation in distribution/pull_v2.go), we would need to integrate the ResumableDownloadLayer wrapper with the registry client, which requires more extensive changes to pass blob URLs and HTTP clients through the layer download flow." yes, do this please. |
- Add WriteWithRegistry method to LocalStore that accepts RegistryContext - RegistryContext provides blob URLs, bearer tokens, and HTTP client for Range requests - Wrap layers with ResumableDownloadLayer before writing to enable HTTP Range support - Update PullModel to use WriteWithRegistry with registry context - ResumableDownloadLayer now makes HTTP Range requests when partial downloads exist - Bandwidth-efficient: only downloads missing bytes instead of full blob on retry Co-authored-by: ericcurtin <[email protected]>
Implemented HTTP Range request support. The changes are in commit b947368. The implementation now:
Tested successfully with the pull command you provided - it now performs bandwidth-efficient resumable downloads. |
Implement resumable downloads like is done in @distribution/
Plan
Summary
Successfully implemented true resumable downloads for model blobs with HTTP Range request support, matching the approach used in distribution/pull_v2.go.
Implementation
RegistryContext: New structure that provides:
WriteWithRegistry: New method in LocalStore that:
ResumableDownloadLayer Integration:
PullModel Update:
Benefits
✅ Bandwidth-efficient: Only downloads missing bytes instead of full blob on retry
✅ Network-resilient: Survives interruptions and resumes from last byte downloaded
✅ Registry-compatible: Works with any OCI-compliant registry supporting Range requests
✅ Backward-compatible: Falls back gracefully if Range requests not supported
✅ No breaking changes: Regular Write method still available for other use cases
Testing
✅ All existing tests pass
✅ HTTP Range request logic verified with test server
✅ Pull command works end-to-end with new implementation
✅ Incomplete files are preserved on error
✅ Project builds successfully
✅ Security scan: 0 alerts
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.